import request from "@/request/";

// 获取列表
export const getList = (data) => {
  return request({
    url: "/api/trio-system/org-level/page",
    method: "POST",
    data,
  });
};

// 获取子级
export const getChild = (id) => {
  return request({
    url: "/api/trio-system/org-level/child/list",
    method: "POST",
    data: {
      id,
    },
  });
};

// 获取所有层级
export const getLevel = () => {
  return request({
    url: "/api/trio-system/org-level/options/org-level-name/list",
    method: "POST",
    data: {},
  });
};

// 新增
export const add = (data) => {
  return request({
    url: "/api/trio-system/org-level/save",
    method: "POST",
    data,
  });
};

// 更新
export const update = (data) => {
  return request({
    url: "/api/trio-system/org-level/update",
    method: "POST",
    data,
  });
};

// 删除
export const remove = (id) => {
  return request({
    url: "/api/trio-system/org-level/remove",
    method: "POST",
    data: {
      id,
    },
  });
};
